﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WastedMechanics.CharState
{
    class CharStateIdlePistolRecoil : CharStateIdle
    {
        public CharStateIdlePistolRecoil(Character chr)
            : base(chr, "IdlePistolShoot")
        {
        }

        public override void Enter()
        {
            base.Enter();
            Character.ResetAnimation(AnimationName);
            Character.IsAiming = true;
        }

        public override void Exit()
        {
            base.Exit();
            Character.IsAiming = false;
        }

        public override void Update()
        {
            base.Update();
            if (Character.AnimBlender.Target.TimePosition > Character.AnimBlender.Target.Length * 0.99f)
                if (Character.IsAiming)
                    Character.SwitchState(new CharStateIdlePistolAim(Character));
                else
                    Character.SwitchState(new CharStateIdlePistol(Character));
        }

        public override CharState GetWalkState()
        {
            return new CharStateWalkPistol(Character);
        }
        public override CharState GetRunState()
        {
            return new CharStateRunPistolRecoil(Character);
        }
        public override CharState GetFallState()
        {
            return new CharStateFallPistol(Character);
        }
        public override CharState GetJumpStandState()
        {
            return new CharStateJumpStandPistol(Character);
        }
    }
}
